#!/bin/sh /etc/rc.common
# Copyright (C) 2017 www.codewasp.cn
START=99
USE_PROCD=1

APPCTRL_BIN="/usr/sbin/appctrl"

start_service() {
	Enable=`uci -q get appctrl.@appctrl[0].enable`	
	[ "$Enable" != "1" ] && exit 1
	
	procd_open_instance
	procd_set_param respawn
	procd_set_param stderr 1
	procd_set_param command "$APPCTRL_BIN"
	procd_close_instance
}

stop_service() {
	service_stop /usr/sbin/appctrl
}

restart() {
	stop
	
	sleep 1

	start
}
